//
//  ViewController.m
//  leo
//
//  Created by zz on 16/3/10.
//  Copyright © 2016年 zz. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blueColor];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
    button.titleLabel.text  = @"fefwe";
    button.backgroundColor = [UIColor redColor];
//    button.
    UISegmentedControl *segment = [[UISegmentedControl alloc]initWithItems:@[@"111",@"222"]];
//    segment.frame = CGRectMake(0, 0, 200,0);
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];

    self.navigationItem.titleView = segment;
    
    self.navigationItem.titleView.frame = CGRectMake(0, 0, 300, 20);
    
    self.navigationItem.rightBarButtonItem  = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(did)];
//    NSLog(@"%@",self.navigationItem.leftBarButtonItem.description);

}

-(void)did{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
